package com.wtwd.wtwddevice.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.wtwd.wtwddevice.model.entity.DeviceStatus;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author mjy
 * @since 2024-04-28
 */
public interface IDeviceStatusService extends IService<DeviceStatus> {

    /**
     * 插入或更新设备状态表信息
     *
     * @param deviceStatus
     * @return
     */
    boolean insertOrUpdate(DeviceStatus deviceStatus);

    /**
     * 设备下线
     *
     * @param deviceKey
     * @return
     */
    boolean downLine(Long deviceKey);


    /**
     * 暂时只用于修改电量和修改离线状态
     * @param deviceStatus
     * @return
     */
    int editDeviceStatus(DeviceStatus deviceStatus);

    /**
     * 更新设备上传心跳包数据
     *
     * @param deviceId
     * @param battery
     * @param step
     * @param wearingState
     * @return
     */
    boolean updateStatus(Long deviceId, String battery, String step, String wearingState);

    /**
     * 获取设备在线状态
     *
     * @param deviceId
     * @return
     */
    boolean getDeviceOnlineState(Long deviceId);
}
